package com.ukao.steward.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.ukao.steward.util.CheckUtils;

/**
 * Created by ukaodev on 2017/10/14.
 */

public class UserInfoCard extends  BaseBean<UserInfoCard> implements Parcelable {


    /**
     * phone : 18573160234
     * headimgPath : null
     * isBinding : 1
     * rfidNo : 204403198
     * mercLogoPath : http://cdn.ukaocloud.cn/img/10164a31-063c-41fa-a0e5-a88ccbceaf4a.png
     * cardName : 红钻会员卡
     * userId : 25
     * cardDiscount : 20
     * cardNo : 496896999
     * cardLevel : 6
     * cardDiscountName : 无折扣
     * mercName : 友靠商户
     * balance : 888472
     * cardId : 8
     * wxNickname : null
     * refidId : 982
     * name : duanfuwe1
     */
    private String attr;
    private String phone;
    private String headimgPath;
    private int isBinding;
    private String rfidNo;
    private String mercLogoPath;
    private String cardName;
    private int userId;
    private int cardDiscount;
    private String cardNo;
    private String cardLevel;
    private String cardDiscountName;
    private String mercName;
    private int balance;
    private int cardId;
    private String wxNickname;
    private int refidId;
    private String name;




    public String getAttr() {
        return attr;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getHeadimgPath() {
        return headimgPath;
    }

    public void setHeadimgPath(String headimgPath) {
        this.headimgPath = headimgPath;
    }

    public boolean getIsBinding() {
        boolean  isBindings=false;
        if ( isBinding==1){
            isBindings=true;
        }
        return isBindings;
    }

    public void setIsBinding(int isBinding) {
        this.isBinding = isBinding;
    }

    public String getRfidNo() {
        return rfidNo;
    }

    public void setRfidNo(String rfidNo) {
        this.rfidNo = rfidNo;
    }

    public String getMercLogoPath() {
        return mercLogoPath;
    }

    public void setMercLogoPath(String mercLogoPath) {
        this.mercLogoPath = mercLogoPath;
    }

    public String getCardName() {
        return cardName;
    }

    public void setCardName(String cardName) {
        this.cardName = cardName;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getCardDiscount() {
        return cardDiscount;
    }

    public void setCardDiscount(int cardDiscount) {
        this.cardDiscount = cardDiscount;
    }

    public String getCardNo() {
        return CheckUtils.isEmptyString(cardNo);
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getCardLevel() {
        return cardLevel;
    }

    public void setCardLevel(String cardLevel) {
        this.cardLevel = cardLevel;
    }

    public String getCardDiscountName() {
        if (CheckUtils.isEmpty(cardDiscountName)){
            cardDiscountName="无折扣";
        }else{
            if (!cardDiscountName.contains("折")){
                cardDiscountName=cardDiscountName+"折";
            }

        }
        return cardDiscountName;
    }

    public void setCardDiscountName(String cardDiscountName) {
        this.cardDiscountName = cardDiscountName;
    }

    public String getMercName() {
        return mercName;
    }

    public void setMercName(String mercName) {
        this.mercName = mercName;
    }

    public int getBalance() {
        return balance;
    }

    public void setBalance(int balance) {
        this.balance = balance;
    }

    public int getCardId() {
        return cardId;
    }

    public void setCardId(int cardId) {
        this.cardId = cardId;
    }

    public String getWxNickname() {
        return wxNickname;
    }

    public void setWxNickname(String wxNickname) {
        this.wxNickname = wxNickname;
    }

    public int getRefidId() {
        return refidId;
    }

    public void setRefidId(int refidId) {
        this.refidId = refidId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.attr);
        dest.writeString(this.phone);
        dest.writeString(this.headimgPath);
        dest.writeInt(this.isBinding);
        dest.writeString(this.rfidNo);
        dest.writeString(this.mercLogoPath);
        dest.writeString(this.cardName);
        dest.writeInt(this.userId);
        dest.writeInt(this.cardDiscount);
        dest.writeString(this.cardNo);
        dest.writeString(this.cardLevel);
        dest.writeString(this.cardDiscountName);
        dest.writeString(this.mercName);
        dest.writeInt(this.balance);
        dest.writeInt(this.cardId);
        dest.writeString(this.wxNickname);
        dest.writeInt(this.refidId);
        dest.writeString(this.name);
        dest.writeString(this.rfidNo);
    }

    public UserInfoCard() {
    }

    protected UserInfoCard(Parcel in) {
        this.attr = in.readString();
        this.phone = in.readString();
        this.headimgPath = in.readString();
        this.isBinding = in.readInt();
        this.rfidNo = in.readString();
        this.mercLogoPath = in.readString();
        this.cardName = in.readString();
        this.userId = in.readInt();
        this.cardDiscount = in.readInt();
        this.cardNo = in.readString();
        this.cardLevel = in.readString();
        this.cardDiscountName = in.readString();
        this.mercName = in.readString();
        this.balance = in.readInt();
        this.cardId = in.readInt();
        this.wxNickname = in.readString();
        this.refidId = in.readInt();
        this.name = in.readString();
        this.rfidNo = in.readString();
    }

    public static final Creator<UserInfoCard> CREATOR = new Creator<UserInfoCard>() {
        @Override
        public UserInfoCard createFromParcel(Parcel source) {
            return new UserInfoCard(source);
        }

        @Override
        public UserInfoCard[] newArray(int size) {
            return new UserInfoCard[size];
        }
    };
}

